/* GUI CONVERTED from rwarrp.p (converter v1.75) Sat Aug 12 23:17:09 2000 */
/* rwarrp.p - ALTERNATE ITEM ROUTING REPORT                             */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert rwarrp.p (converter v1.00) Fri Oct 10 13:57:20 1997 */
/* web tag in rwarrp.p (converter v1.00) Mon Oct 06 14:17:46 1997 */
/*F0PN*/ /*K111*/ /*                                                    */
/*V8:ConvertMode=FullGUIReport                                 */
/* REVISION: 6.0             LAST EDIT: 04/15/91       MODIFIED BY: emb *D342*/
/* REVISION: 7.0             LAST EDIT: 04/29/92       MODIFIED BY: emb *F457*/
/* REVISION: 8.6             LAST EDIT: 10/15/97       MODIFIED BY: bvm *K111*/
/* REVISION: 9.1         LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1         LAST MODIFIED: 08/12/00 BY: *N0KP* myb              */

/*K111*/ /* DISPLAY TITLE */

/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K111*/ {mfdtitle.i "b+ "} /*F457*/

define variable part1 like ptr_part.
define variable part2 like ptr_part.
define variable routing1 like ptr_routing.
define variable routing2 like ptr_routing.
define variable site1 like ptr_site.
define variable site2 like ptr_site.
define variable date1 like tr_effdate.
define variable date2 like tr_effdate.
define variable partdesc2 like pt_desc2 no-undo.

/*K111* *moved up*
 * /* DISPLAY TITLE */
 * {mfdtitle.i "b+ "} /*F457*/
 *K111*/


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
part1     colon 22     part2     label {t001.i} colon 49
   site1     colon 22     site2     label {t001.i} colon 49
   routing1  colon 22     routing2  label {t001.i} colon 49
/* date1     colon 22     date2     label {t001.i} colon 49 */
   skip
 SKIP(.4)  /*GUI*/
with frame a width 80 side-labels attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K111*/ {wbrp01.i}


/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:


   /* INPUT FORM */
   if site2  = hi_char then site2  = "".
   if part2    = hi_char then part2    = "".
   if routing2 = hi_char then routing2 = "".
   if date2 = hi_date then date2 = ?.
   if date1 = low_date then date1 = ?.

/*K111*/ if c-application-mode <> 'web' then
   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K111*/ {wbrp06.i &command = update &fields = "  part1 part2 site1 site2
          routing1 routing2 " &frm = "a"}

/*K111*/ if (c-application-mode <> 'web') or
/*K111*/ (c-application-mode = 'web' and
/*K111*/ (c-web-request begins 'data')) then do:

   bcdparm = "".
   {mfquoter.i part1    }
   {mfquoter.i part2    }
   {mfquoter.i site1  }
   {mfquoter.i site2  }
   {mfquoter.i routing1 }
   {mfquoter.i routing2 }
/* {mfquoter.i date1 }
   {mfquoter.i date2 } */

   if part2    = "" then part2    = hi_char.
   if site2  = "" then site2  = hi_char.
   if routing2 = "" then routing2 = hi_char.
   if date2 = ? then date2 = hi_date.
   if date1 = ? then date1 = low_date.

/*K111*/ end.

   /* SELECT PRINTER */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:



   {mfphead.i}

   for each ptr_det no-lock where
   ptr_part >= part1 and ptr_part <= part2
   and ptr_site >= site1 and ptr_site <= site2
   and ptr_routing >= routing1 and ptr_routing <= routing2
   and (ptr_start <= date2 or ptr_start = ?)
   and (ptr_end >= date1 or ptr_end = ?)
   use-index ptr_part break by ptr_part
   with frame b width 132 no-attr-space:

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame b:handle).

      if first-of (ptr_part) then do with frame b:
     find pt_mstr no-lock where pt_part = ptr_part no-error.
     display ptr_part WITH STREAM-IO /*GUI*/ .
     if available pt_mstr then display pt_desc1 pt_um WITH STREAM-IO /*GUI*/ .
     partdesc2 = pt_desc2.
      end.
      else do with frame b:
     if partdesc2 > "" then display partdesc2 @ pt_desc1 WITH STREAM-IO /*GUI*/ .
     partdesc2 = "".
      end.

      display ptr_site WITH STREAM-IO /*GUI*/ .

      find ptp_det no-lock where ptp_part = ptr_part
      and ptp_site = ptr_site no-error.
      if available ptp_det and ptp_routing = ptr_routing
/*F457*  and ptp_bom_code = ptr_user1 then */
/*F457*/ and ptp_bom_code = ptr_bom_code then
      display "*" WITH STREAM-IO /*GUI*/ .

      display ptr_routing
/*F457*  ptr_user1 @ ptp_bom_code. */
/*F457*/ ptr_bom_code @ ptp_bom_code WITH STREAM-IO /*GUI*/ .

      if partdesc2 > "" and last-of (ptr_part)
      then do with frame b:
     down 1.
     display partdesc2 @ pt_desc1 WITH STREAM-IO /*GUI*/ .
     partdesc2 = "".
      end.

      if last-of (ptr_part) then display skip WITH STREAM-IO /*GUI*/ .

      
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/

   end.

   /* REPORT TRAILER */
   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

end.

/*K111*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" part1 part2 site1 site2 routing1 routing2  "} /*Drive the Report*/
